<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">
        <div th:replace="tophtml::html"></div>
        <div th:replace="left::html"></div>
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    客户:<span th:text="${customerName}"></span>-----<span>需求列表</span> 
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a th:href="@{/index}"><i class="fa fa-dashboard"></i>用户中心</a></li>
                    <li><a href="">需求管理</a></li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content container-fluid">
               <form class="form-inline" th:action="@{/customer/customerDemandList}" method="get" id="from1">
                    <input type="hidden" name="pid" th:value="${customerId}" /> 
                <div class="box">
                    <div class="box-body">
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <th>需求id</th>
                                    <th>需求名称</th>
                                    <th>需求类型</th>
                                    <th>需求状态</th>
                                    <th>需求联系人</th>
                                    <th>操作</th>
                                </tr>
                                <!-- <div th:if="${pageInfo.list!=null}"> -->
                                <tr th:each="demand : ${pageInfo.list}">
                                    <td title="查看需求详情">
                                        <a th:href="@{'/demand/showDetail?demandId='+${demand.pid}}" th:text="'D' + ${demand.demandNumber}">详情</a>
                                    </td>
                                    <td width="25%">
                                        <div class="col-md-3" style="width:100%;font-size: 14px;">
                                            <div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
                                                <div class="box-header with-border">
                                                    <span th:if="${#strings.length(demand.demandName)>20}">
                                                        <span th:text="${#strings.substring(demand.demandName,0,20)+'......'}"></span>
                                                    </span>
                                                    <span th:unless="${#strings.length(demand.demandName)>20}">
                                                        <span th:text="${demand.demandName}"></span>
                                                    </span>
                                                    <div class="box-tools pull-right" th:if="${#strings.length(demand.demandName)>20}">
                                                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                                            <i class="fa fa-plus"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div class="box-body">
                                                    <span th:text="${demand.demandName}"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td th:text="${demand.demandType}">类型</td>
                                    <td th:text="${demand.demandStatusWorth}">状态</td>
                                    <td>
                                        <a th:href="@{'/demand/showUpdateContact?demandContactId='+${demand.per == null ? '' : demand.per.pid}}" th:text="${demand.per == null ? '' : demand.per.name}">联系人</a>
                                    </td>
                                    <td>
                                     
                                     <a th:href="@{'/project/showDemandMatchedProject?pid='+${demand.pid}}+'&customerId='+${customerId}">匹配</a>
                                     <!--  <a th:href="@{'/customer/showDemandMatchedProject?pid='+${demand.pid}+'&customerId='+${customerId}+'&demandNumber='+${demand.demandNumber}+'&demandName='+${demand.demandName}}">匹配</a> -->
                                       <!--  <a th:href="@{'/demand/showUpdate?demandId='+${demand.pid}}">修改</a>|
                                        <a th:unless="${demand.per}" th:href="@{'/demand/showAddContact?demandId='+${demand.pid}}">添加联系人</a>
                                        <a th:href="@{'/project/showDemandMatchedProject?pid='+${demand.pid}+'&demandNumber='+${demand.demandNumber}+'&demandName='+${demand.demandName}}">匹配项目</a>|
                                        <a th:href="@{'/person/showDemandMatchedExpert?pid='+${demand.pid}+'&demandNumber='+${demand.demandNumber}+'&demandName='+${demand.demandName}}">匹配专家</a><br>
                                        <a th:href="@{'/demand/showProjectButtDetail?demandId='+${demand.pid}}">对接项目详情</a>|
                                        <a th:href="@{'/demand/showExpertButtDetail?demandId='+${demand.pid}}">对接专家详情</a>|
                                        <a href="javascirpt:void(0)" th:onclick="'javascript:subscribe(\''+${demand.pid}+'\',2)'">关注</a> -->
                                    </td>
                                </tr>
                                <!-- </div> -->
                            </tbody>
                        </table>
                        <div th:replace="page::html"></div>
                        <p style="color: red;" th:text="${demandContactIdExists}"></p>
                    </div>
                </div>
                </form>
            </section>
        </div>
        
         <!-- 返回按钮 -->
					<div style="width:240px; height: 30px; position:fixed;left:727px;bottom:10px;">
						<a href="/customer/customerList" class="btn btn-primary">返回主页面</a>
						<button style="margin-left: 30px;" type="button" class="btn btn-primary" onclick="window.history.go(-1)">返回上一级</button>
					</div>
					
        <!-- Main Footer -->
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>
    <div th:replace="bottom::html"></div>
</body>

</html>